package com.gaogzhen.web;

import com.gaogzhen.domain.Account;
import com.gaogzhen.service.AccountService;

import java.math.BigDecimal;

/**
 * @author Administrator
 * @date 2022-12-05 10:20
 */
public class AccountWeb {
    public static void main(String[] args) {
        Account a = new Account(1, "张三", new BigDecimal(1000));
        Account b = new Account(2, "李四", new BigDecimal(1000));

        AccountService service = new AccountService();
        boolean succ = service.transfer(a, b, new BigDecimal(100));
        if (succ) {
            System.out.println("转账成功");
        } else {
            System.out.println("转账失败");
        }
        System.out.println(service.getById(a.getId()));
        System.out.println(service.getById(b.getId()));
        service.close();
    }
}
